﻿using System;
using System.Collections.Generic;
using System.Text;
using GalaSoft.MvvmLight.Ioc;
using MasterDetailTemplate.Services;
using MasterDetailTemplate.Services.Implementations;

namespace MasterDetailTemplate.ViewModels {
    public class ViewModelLocator {
        public MainPageViewModel MainPageViewModel =>
            SimpleIoc.Default.GetInstance<MainPageViewModel>();

        public MenuPageViewModel MenuPageViewModel =>
            SimpleIoc.Default.GetInstance<MenuPageViewModel>();

        public InitializationPageViewModel InitializationPageViewModel =>
            SimpleIoc.Default.GetInstance<InitializationPageViewModel>();

        public HomePageViewModel HomePageViewModel =>
            SimpleIoc.Default.GetInstance<HomePageViewModel>();

        public AddEventViewModel AddEventViewModel =>
            SimpleIoc.Default.GetInstance<AddEventViewModel>();

        public AnniversaryPageViewModel AnniversaryPageViewModel =>
            SimpleIoc.Default.GetInstance<AnniversaryPageViewModel>();

        public AnniversarySearchPageViewModel AnniversarySearchPageViewModel =>
            SimpleIoc.Default.GetInstance<AnniversarySearchPageViewModel>();

        public AnniversaryDetailPageViewModel AnniversaryDetailPageViewModel =>
            SimpleIoc.Default.GetInstance<AnniversaryDetailPageViewModel>();

        public AnniversaryChangePageViewModel AnniversaryChangePageViewModel =>
            SimpleIoc.Default.GetInstance<AnniversaryChangePageViewModel>();

        public CountdownSearchPageViewModel CountdownSearchPageViewModel =>
            SimpleIoc.Default.GetInstance<CountdownSearchPageViewModel>();

        public SearchPageViewModel SearchPageViewModel =>
            SimpleIoc.Default.GetInstance<SearchPageViewModel>();

        public DataSynchronizationPageViewModel DataSynchronizationPageViewModel =>
            SimpleIoc.Default.GetInstance<DataSynchronizationPageViewModel>();

        public TimelineViewModel TimelineViewModel =>
            SimpleIoc.Default.GetInstance<TimelineViewModel>();

        public ViewModelLocator() {
            SimpleIoc.Default.Register<MainPageViewModel>();
            SimpleIoc.Default.Register<MenuPageViewModel>();
            SimpleIoc.Default.Register<InitializationPageViewModel>();
            SimpleIoc.Default.Register<HomePageViewModel>();
            SimpleIoc.Default.Register<AddEventViewModel>();
            SimpleIoc.Default.Register<AnniversaryPageViewModel>();
            SimpleIoc.Default.Register<AnniversarySearchPageViewModel>();
            SimpleIoc.Default.Register<AnniversaryDetailPageViewModel>();
            SimpleIoc.Default.Register<AnniversaryChangePageViewModel>();
            SimpleIoc.Default.Register<CountdownSearchPageViewModel>();
            SimpleIoc.Default.Register<SearchPageViewModel>();
            SimpleIoc.Default.Register<TimelineViewModel>();

            SimpleIoc.Default.Register<DataSynchronizationPageViewModel>();

            SimpleIoc.Default.Register<IEventStorage, EventStorage>();
            SimpleIoc.Default.Register<IPreferenceStorage, PreferenceStorage>();
            SimpleIoc.Default
                .Register<IContentPageActivationService,
                    ContentPageActivationService>();
            SimpleIoc.Default
                .Register<IContentNavigationService,
                    ContentNavigationService>();
            SimpleIoc.Default
                .Register<IRootPageActivationService,
                    CachedRootPageActivationService>();
            SimpleIoc.Default
                .Register<IRootNavigationService, RootNavigationService>();
            SimpleIoc.Default.Register<OneDriveEventStorage>();
            SimpleIoc.Default.Register<IHistoryTodayService, HistoryTodayService>();
        }
    }
}